package oop3.src.innerclass_anonymous;

import javax.swing.*;

/**
 * 匿名内部类在实际开发中的应用
 */
public class Test2 {
    public static void main(String[] args) {
        //创建窗口
        JFrame win = new JFrame("Login");
        JPanel panel = new JPanel();
        win.add(panel);

        //创建按钮对象
        JButton btn = new JButton("登录");

        //

        //把按钮对象放在桌布上展示
        panel.add(btn);

        //展示窗口
        win.setSize(400,300);
        win.setLocationRelativeTo(null);
        win.setVisible(true);
    }
}
